Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add /lock command for converting editable files to read-only #2419

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

thomasmison
Copy link

This PR introduces a new /lock command that enables users to convert all currently editable files in their chat session to read-only mode.

Previously, achieving this required manually using the /read-only command for each file, along with copying and pasting file names to ensure the correct files were selected.

@CLAassistant
Copy link

CLAassistant commented Nov 21, 2024

CLA assistant check
All committers have signed the CLA.

@paul-gauthier
Copy link
Collaborator

Thanks for your interest in aider and for making this PR.

Can you help me understand why this is such a common use case so as to need a dedicated command?

@paulsharratt0
Copy link

paulsharratt0 commented Dec 8, 2024

Often experienced developers using Aider will follow a process like this:

Create or update file with new feature/functionality
Perform series of edits to file until they're happy with it
Move on to secondary files impacted by the addition/edit, often this will involve a back and forth to fix issues in first file
Move on to tertiary files.

As the developer moves through secondary/tertiary impacted files, previous files can become set in stone, but need to stay in the context window so the LLM can understand how the architecture has changed. The user wants to steadily move files into the read-only context to avoid the LLM accidentally editing the wrong files

Often the process will roll out through the codebase like a ripple, adding files to write, then moving to read, then removing from context entirely. Right now you can add to write and remove from context via single command, but moving to read only needs a drop then a read command. It's quite frustrating and I find myself not bothering to move files to read-only, and then the LLM makes a write to them when I didn't want it to.

@paul-gauthier
Copy link
Collaborator

Thank for explaining! Makes sense.

I just changed /read-only so that if you run it with no args it makes all added files read-only.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants